home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / mac / Chapter Tutorials / CaseStudies / ch12.ISN / input.dir / 00060.ls < prev    next >
Encoding:
Text File  |  1996-12-04  |  1.2 KB  |  37 lines

  1. global gMyMessage, gCharToNumList, gCharColorList, gMessageLength, gIterCount, gStopFlag, gMyWindow
  2.  
  3. on mouseUp
  4.   set gMyMessage to the text of field "Message"
  5.   set gCharColorList to [225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225]
  6.   repeat with i = 1 to the number of chars in gMyMessage
  7.     set theColor to the foreColor of char i of field "Message"
  8.     if theColor = 255 then
  9.       set theColor to 225
  10.     end if
  11.     append(gCharColorList, theColor)
  12.   end repeat
  13.   repeat with i = 1 to 35
  14.     append(gCharColorList, 255)
  15.   end repeat
  16.   set gMyMessage to "                                   " & gMyMessage & "                                   "
  17.   set gCharToNumList to []
  18.   cursor(4)
  19.   repeat with y = 1 to the number of chars in gMyMessage
  20.     set myCharToNum to the number of member char y of gMyMessage
  21.     add(gCharToNumList, myCharToNum)
  22.   end repeat
  23.   cursor(-1)
  24.   set gMessageLength to the number of chars in gMyMessage
  25.   set gIterCount to 0
  26.   if gStopFlag then
  27.     tell gMyWindow
  28.       go("WriteNStop")
  29.     end tell
  30.   else
  31.     tell gMyWindow
  32.       go("Write Message")
  33.     end tell
  34.   end if
  35.   go("Run")
  36. end
  37.